//用户模块
import { makeAutoObservable } from "mobx";

import { http } from "@/utils";
class UserStore {
  userInfo = {};
  constructor() {
    makeAutoObservable(this);
  }
  //请求获取数据
  getUserInfo = async () => {
    const res = await http.get("/user/profile");
    this.setUserInfo(res.data);
  };
  //更新用户store状态
  setUserInfo = (data) => {
    this.userInfo = data;
  };
}
export default UserStore;
